<%@ Page Language="C#" MasterPageFile="~/SurveyHost.Master" AutoEventWireup="true"
    CodeBehind="DataRetrieval.aspx.cs" Inherits="SurveyHost.Web.Admin.DataRetrieval"
    Title="Manage survey data" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="post">
        <h1 class="title">
            Data Retrieval
        </h1>
        <p class="byline">
            Retrieve data as an xlsx (Excel 2007) file
        </p>
        <div class="entry">
            (If you do not have Office 2007, you can download the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en">
                Office compatability pack here</a>)<br />
            Enter the minimum length of time for a survey (in minutes):
            <asp:TextBox runat="server" ID="timespan" CausesValidation="True" ValidationGroup="Default">0</asp:TextBox><br />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="timespan"
                Display="Dynamic" ValidationGroup="Default">
                Please enter a time in minutes<br /></asp:RequiredFieldValidator>
            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="timespan"
                Display="Dynamic" MaximumValue="1051200" MinimumValue="0" Type="Integer" ValidationGroup="Default">
                Please enter a value between 0 and 1051200 (2 years)<br />
            </asp:RangeValidator><br />
            <asp:Button ID="download" runat="server" Text="Download data" OnClick="download_Click"
                ValidationGroup="Default" />
        </div>
    </div>
    <div class="post">
        <h1 class="title">
            Data Management
        </h1>
        <p class="byline">
            Manage survey data
        </p>
        <div class="entry">
            WARNING: Clicking any of the links below is irreversable.&nbsp; You should never
            click any of these unless instructed to.<br />
            <br />
            <asp:CheckBox runat="server" ID="UserIsFoolish" Text="I understand the consequences and wish to do something very bad"
                AutoPostBack="true" />
            <asp:Panel runat="server" Visible='<%# UserIsFoolish.Checked %>'>
                <p>
                    To clear all current surveys and answers,
                    <asp:LinkButton ID="clearAnswers" runat="server" OnClick="clearAnswers_Click">click here</asp:LinkButton>.<br />
                    To clear all records of user status,
                    <asp:LinkButton ID="clearStatus" runat="server" OnClick="clearStatus_Click">click here</asp:LinkButton>.<br />
                    To clear all questions,
                    <asp:LinkButton ID="clearQuestions" runat="server" OnClick="clearQuestions_Click">click here</asp:LinkButton>.<br />
                    To clear all measures and questions,
                    <asp:LinkButton ID="clearMeasuresAndQs" runat="server" OnClick="clearMeasuresAndQs_Click">click here</asp:LinkButton>.<br />
                    To clear everything,
                    <asp:LinkButton ID="clearAll" runat="server" OnClick="clearAll_Click">click here</asp:LinkButton>.<br />
                    <asp:Label runat="server" ID="result" EnableViewState="false"></asp:Label>
                </p>
            </asp:Panel>
        </div>
    </div>
</asp:Content>
